from langchain_community.callbacks import get_openai_callback
from langchain_openai import OpenAI

llm = OpenAI(
    temperature=0,
    openai_api_key="sk-rgymzddvnnrgwawnkevkdzlxkxfvhbviqgibbfgpvsyoqtur",
    openai_api_base="https://api.siliconflow.cn/v1",
    model="deepseek-ai/DeepSeek-R1-0528-Qwen3-8B"
)

with get_openai_callback() as cb:
    result = llm.invoke("给我说个笑话")
    print(result)
    print(cb)





